package sc.tool.sqlgen.branchinfo.fos;

import sc.prototype.common.Utils;
import sc.tool.sqlgen.branchinfo.BranchInfo;

public class BranchChange {

    public BranchChange(BranchInfo old, BranchInfo latest) {
        this.old = old;
        this.latest = latest;
    }

    int diffCount;
    String diffDesc;
    BranchInfo old;
    BranchInfo latest;

    public void addDiff(String diff) {
        if (diffDesc == null) {
            diffDesc = diff;
        } else {
            diffDesc += diff + ", ";
        }
        diffCount++;
    }

    public BranchInfo getOld() {
        return old;
    }

    public void setOld(BranchInfo old) {
        this.old = old;
    }

    public BranchInfo getLatest() {
        return latest;
    }

    public void setLatest(BranchInfo latest) {
        this.latest = latest;
    }

    @Override
    public String toString() {
        return Utils.toString(this);
    }

}
